home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / unix / amiga / 716 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.2 KB

  1. Path: gold.tc.umn.edu!yeun0001
  2. From: yeun0001@gold.tc.umn.edu
  3. Newsgroups: comp.os.linux.networking,comp.unix.admin,comp.unix.misc,comp.unix.questions,comp.unix.amiga
  4. Subject: Re: SLIP gateway on a local network
  5. Date: 22 Mar 1996 15:09:40 -0600
  6. Organization: University of Minnesota - Twin Cities
  7. Message-ID: <yeun0001.827526406@gold.tc.umn.edu>
  8. References: <314B4C05.7FD76F10@bbs.infosquare.it> <314F99EB.794B@hidro1.ist.utl.pt> <4iujal$32d@hamilton.maths.tcd.ie>
  9. NNTP-Posting-Host: gold.tc.umn.edu
  10.  
  11. tim@maths.tcd.ie (Timothy Murphy) writes:
  12.  
  13. >Pedro Miguel Sequeira de Justo Teixeira <pmt@hidro1.ist.utl.pt> writes:
  14.  
  15. >>> I own two UNIX machines connected via Ethernet: A and B.
  16. >>> One system (A) is also connected to internet via SLIP (dynamic IP).
  17. >>> How can i use the SLIP connection also on the other machine (B) ?
  18. >>> I tried (in B) adding a default route to A, it seems that packets are sent but not
  19. >>> received.
  20.  
  21. >>    You must recompile the kernel with the GateWaying
  22. >>option ON (it is off by default) for Machine B.
  23.  
  24. >Have you actually done this?
  25. >If so, please just tell us what you put in the relevant /etc files.
  26.  
  27. I think I'll post my method here so someone can try it out:
  28.  
  29. 1. Assume that Machine A has a modem and will be used to dial out and
  30.    establish SLIP connection.
  31.  
  32. 2. get "ipfwadm" from ftp://ftp.xos.nl/pub/linux/ipfwadm/
  33.    and install the program.
  34.    For kernel version 1.3.60 or older, get ipfwadm-1.2.tar.gz
  35.    Otherwise, get ipfwadm-2.0beta2.tar.gz. 
  36.  
  37. 3. Before we setup the connection, recompile the kernel in Machine A
  38.    with CONFIG_FIREWALL, CONFIG_IP_FORWARD, CONFIG_IP_FIREWALL, and
  39.    CONFIG_IP_MASQUERADE set to 'y'.
  40.  
  41. 4. Connect A and B via ethernet and assign an IP address to each of them.
  42.    (In this case, A is 10.0.0.1, and B is 10.0.0.2)
  43.  
  44. 5. Modify /etc/rc.d/rc.inet1 in Machine A to:
  45.     #! /bin/sh
  46.     HOSTNAME=`cat /etc/HOSTNAME`
  47.     /sbin/ifconfig lo 127.0.0.1
  48.     /sbin/route add -net 127.0.0.0
  49.     IPADDR="10.0.0.1"
  50.     NETMASK="255.0.0.0"
  51.     NETWORK="10.0.0.0"
  52.     BROADCAST="10.0.0.255"
  53.     /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
  54.     /sbin/route add -net ${NETWORK} netmask ${NETMASK}
  55.  
  56. 6. Then, modify /etc/rc.d/rc.inet1 in Machine B to:
  57.     #! /bin/sh
  58.     HOSTNAME=`cat /etc/HOSTNAME`
  59.     /sbin/ifconfig lo 127.0.0.1
  60.     /sbin/route add -net 127.0.0.0
  61.     IPADDR="10.0.0.2"
  62.     NETMASK="255.0.0.0"
  63.     NETWORK="10.0.0.0"
  64.     BROADCAST="10.0.0.255"
  65.     GATEWAY="10.0.0.1"
  66.     /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
  67.     /sbin/route add -net ${NETWORK} netmask ${NETMASK}
  68.     /sbin/route add default gw ${GATEWAY} metric 1
  69.     
  70. 7. Execute the 2 scripts to setup local connection.
  71.  
  72. 8. Have Machine A dial out and establish SLIP connection.
  73.  
  74. 9. On Machine A, execute the following commands:
  75.     /sbin/ipfwadm -F -p accept
  76.     /sbin/ipfwadm -F -a masquerade -S 10.0.0.1 -D 0.0.0.0/0
  77.     /sbin/ipfwadm -F -a masquerade -S 10.0.0.2 -D 0.0.0.0/0
  78.  
  79. 10. Machine B should be able to connect to the outside world at this point.
  80.     To make it more convenient, edit /etc/resolv.conf to add a
  81.     nameserver entry and restart inetd.
  82.  
  83. Good luck! :)
  84.  
  85.  
  86. -- Henry Yeung
  87. -- 
  88. Henry Yeung                     = 2015 Riverside Avenue, #203
  89. = yeung@freenet.msp.mn.us       = Minneapolis, MN 55454
  90. = hyeung@empros.com             = Day:  (612)-536-4781
  91. = yeun0001@gold.tc.umn.edu      = Home: (612)-321-0382
  92.